#pragma once

class ADTChunk;

class ADTChunkRender
{
	Texture* mTextures[4];
	ADTChunk* mChunk;
	bool mFirstRender;
	void initialLoad();
	Shader& mShader;
	ui32 mLayers;
	std::vector<D3DXHANDLE> mTextureHandles;
	D3DXHANDLE mAlphaHandle;
public:
	ADTChunkRender(ADTChunk* chunk) : mChunk(chunk), mFirstRender(true), mShader(sShaderMgr.getShader("TerrainShader.fx")) {
	}

	void render();
	Texture* getTexture(ui8 index) {
		if(index >= 4)
			return NULL;
		return mTextures[index];
	}

	void setTexture(ui8 index, Texture* tex) {
		if(index >= 4)
			return;
		mTextures[index] = tex;
	}

	void textureAdded();
};